//本题使用01背包

#include <algorithm>
#include <bitset>
#include <iostream>
using namespace std;

#define ll  long long;

const int N = 1e6 + 7;
const int INF = 0x3f3f3f3f;
const ll MOD = 1e9 + 7;

int n;
int w[N];
bitset<N> dp;

int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> w[i];
	}

	dp[0] = 1;
	for (int i = 1; i <= n; i++) {
		bitset<N> dpt = dp;
		for (int j = 1e5; j >= 0; j--) {
			if (dp[j]) {
				dpt[j + w[i]] = 1;
				dpt[abs(j - w[i])] = 1;
			}
		}
		dp = dpt;
	}
	dp[0] = 0;
	cout << dp.count() << "\n";			//通过调用 dp.count() 来计算可以称出的重量的数量，并将结果输出
	return 0;
}